home *** CD-ROM | disk | FTP | other *** search
- Path: mail2news.demon.co.uk!ues5.cern.ch
- From: Dan Pop <Dan.Pop@cern.ch>
- Newsgroups: comp.lang.c
- Subject: Re: fwrite help?
- Date: Mon, 12 Feb 1996 13:53:45 +0100
- Organization: CERN European Lab for Particle Physics
- Message-ID: <9602121253.AA29675@ues5.cern.ch>
- References: <4fmaig$7of@news.global1.net>
- X-NNTP-Posting-Host: ues5.cern.ch
- X-Newsreader: NN version 6.5.0 #7 (NOV)
- X-Mail2News-Path: mail1.cern.ch!ues5.cern.ch
-
- youngrc@global1.net writes:
-
- >What would the syntax for fwrite be to output 8 characters of
- >char line[10] to a file? K&R doesn't write much about it. Thanks
- >for the help.
-
- I disagree. Page 247 of K&R2 contains all the information you need.
-
- Anyway, the solution is:
-
- fwrite(line, sizeof *line, 8, fp); /* or fwrite(line, 1, 8, fp) */
-
- Dan
- --
- Dan Pop
- CERN, CN Division
- Email: danpop@mail.cern.ch
- Mail: CERN - PPE, Bat. 31 R-004, CH-1211 Geneve 23, Switzerland
-